package main;
import java.util.Arrays;

public class CensoredPrinter extends PrettyPrinter {
	private static final String[] badWords = {"fuck", "tit"};
	public void explore(Post p) {
		String censored = p.getMessage();
		super.explore(p);
		for (String c: Arrays.asList(badWords)) {
			//taken from http://stackoverflow.com/a/4903603
			String r = new String(new char[c.length()]).replace("\0", "*");
			censored = censored.replace(c, r);
		}
		indent(p);
		System.out.println(censored);
	}
}
